import Vue from 'vue'
import VueRouter from 'vue-router';

Vue.use(VueRouter)

import IndexLayout from './layout/IndexLayout.vue'

import Home from '@pages/Home.vue'
import MoreMusic from "@pages/MoreMusic.vue"
import Artist from "@pages/Artist.vue"
import ArtistDetail from "@pages/ArtistDetail.vue"
import Search from "@pages/Search.vue"
import MusicPlay from "@pages/MusicPlay.vue"

const router = new VueRouter({
    routes: [{
            path: '/',
            redirect: '/index'
        },
        {
            path: '/index',
            component: IndexLayout,
            children: [{
                path: '',
                component: Home
            }, {
                path: 'more/:title/:type',
                component: MoreMusic,
                name: 'moreMuisc'
            }, {
                path: 'artist',
                component: Artist,
                meta: {
                    title: '歌手'
                }
            }, {
                path: 'artist/detail/:tinguid',
                component: ArtistDetail,
                name: 'artistDetail'
            }, {
                path: 'search',
                component: Search,
                meta:{
                    title:'搜索界面'
                }
            }]
        }, {
            path: '/music/play/:songId',
            component: MusicPlay,
            name: 'musicPlay'
        }
    ]
})

export default router;